#include<bits/stdc++.h>
using namespace std;
int main(){
	double a , b;
	int y;
	cin >> a >> b;
	y = a / b;
	cout<<a - y * b;
}
